package com.yc.project2.org;

import com.yc.project2.org.springframework.annotation.YcBean;
import com.yc.project2.org.springframework.annotation.YcComponentScan;
import com.yc.project2.org.springframework.annotation.YcConfiguration;
import com.yc.project2.org.springframework.context.YcAnnotationConfigApplicationContext;
import com.yc.project2.org.springframework.context.YcApplicationContext;

/**
 * @author zwei
 * @create 2024-08-01 18:23
 */
@YcConfiguration
//@YcComponentScan(basePackages = "com.yc")
@YcComponentScan(value ="com.yc.project2.org.context.yc")
public class AppConfig {
    @YcBean(value = "a")
    public Apple apple(){
        return new Apple();
    }
    @YcBean(value = "b")
    public Apple snackeapple(){
        return new Apple();
    }
    public static void main(String[] args) {
        YcApplicationContext ac=new YcAnnotationConfigApplicationContext(AppConfig.class);
        Apple a= (Apple) ac.getBean("a");
        Apple b= (Apple) ac.getBean("b");
        System.out.println(a+"\t"+b);
    }
}
